package com.bwie.controller;

import com.bwie.common.domain.Menu;
import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className: UserController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 张雨乐
 * @date: 2025/9/1 9:29
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/phone")
    public Result<User> phone(@RequestBody String phone){
        return userService.phone(phone);
    }
    @PostMapping("/getRole")
    public Result<List<Role>> getRole(@RequestBody Integer id){
        return userService.getRole(id);
    }
    @PostMapping("/menu")
    Result<List<Menu>> menu(@RequestBody String roleId){
        return userService.menu(roleId);
    }
}
